from multiprocessing import Process
from core.proxy_spider.run_spiders import RunSpider
from core.proxy_test import ProxyTest
from core.proxy_api import ProxyApi


def run():
    process_list = [
        Process(target=RunSpider.start),
        Process(target=ProxyTest.start),
        Process(target=ProxyApi.start)
    ]
    for process in process_list:
        process.daemon = True  # 设置守护进程
        process.start()
    for process in process_list:
        process.join()


if __name__ == '__main__':
    run()
